package com.sky.mapper;/*
@author sun
@date 24/07/15
@project IntelliJ IDEA
*/

import com.github.pagehelper.Page;
import com.sky.dto.OrdersPageQueryDTO;
import com.sky.entity.Orders;
import com.sky.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.core.annotation.Order;

@Mapper
public interface OrderMapper {
    // 订单搜索
    Page<OrderVO> pageQuery(OrdersPageQueryDTO ordersPageQueryDTO);

    // 各个状态的订单数量统计
    @Select("select count(id) from orders where status = #{status}")
    Integer countStatus(Integer toBeConfirmed);

    // 接单 修改订单状态
    void update(Orders orders);

    // 根据id查询订单
    @Select("select * from orders where id = #{id}")
    Order getById(Long id);
}
